package com.car.sale.controller;

import com.car.sale.service.CarService;
import com.car.sale.service.MpvService;
import com.car.sale.vo.Count;
import com.car.sale.vo.Month;
import com.car.sale.vo.Result;
import com.car.sale.vo.Top;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/MPV")
@ResponseBody
public class MpvController {
    @Autowired
    private MpvService mpvService;
    //    获得轿车的前20个车类型
    @GetMapping("/top")
    public Result<Object> getMpvTop()
    {
        List<Top> topList = mpvService.getMpvTop();
        return Result.success(topList);
    }
    @GetMapping("/count")
    public Result<Object> getMpvCount()
    {
        List<Count> countList = mpvService.getMpvCount();
        return Result.success(countList);
    }
    @GetMapping("/month")
    public Result<Object> getMpvMonth()
    {
        List<Month> monthList = mpvService.getMpvMonth();
        return Result.success(monthList);
    }
}
